package com.platform.module.dao.service.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.platform.module.dao.entity.TbUserVip;
import com.platform.module.dao.mapper.TbUserVipMapper;
import com.platform.module.dao.service.TbUserVipService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户VIP活动表 服务实现类
 * </p>
 *
 * @author ZM
 * @since 2025-01-07
 */
@Service
public class TbUserVipServiceImpl extends ServiceImpl<TbUserVipMapper, TbUserVip> implements TbUserVipService {

    @Override
    public TbUserVip getByUserId(Long userId) {
        LambdaQueryChainWrapper<TbUserVip> queryChainWrapper = new LambdaQueryChainWrapper<>(getBaseMapper());
        return queryChainWrapper.eq(TbUserVip::getUserId, userId).one();
    }
}
